package com.dbdata.move.model;

// Generated cafuc by Hibernate Tools 4

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * PlanRecordTopic generated by hbm2java
 */
@Entity
@Table(name = "plan_record_topic")
public class PlanRecordTopic implements java.io.Serializable {

	private Long id;
	private Topic topicByTopicId;
	private TrainPlan trainPlan;
	private Topic topicByReviewTopicId;
	private PlanRecord planRecord;
	private Integer actualTrainingTime;
	private String teacherComment;
	private boolean finished;
	private Set<PlanRecordSubject> planRecordSubjects = new HashSet<PlanRecordSubject>(
			0);

	public PlanRecordTopic() {
	}

	public PlanRecordTopic(TrainPlan trainPlan, PlanRecord planRecord,
			boolean finished) {
		this.trainPlan = trainPlan;
		this.planRecord = planRecord;
		this.finished = finished;
	}

	public PlanRecordTopic(Topic topicByTopicId, TrainPlan trainPlan,
			Topic topicByReviewTopicId, PlanRecord planRecord,
			Integer actualTrainingTime, String teacherComment,
			boolean finished, Set<PlanRecordSubject> planRecordSubjects) {
		this.topicByTopicId = topicByTopicId;
		this.trainPlan = trainPlan;
		this.topicByReviewTopicId = topicByReviewTopicId;
		this.planRecord = planRecord;
		this.actualTrainingTime = actualTrainingTime;
		this.teacherComment = teacherComment;
		this.finished = finished;
		this.planRecordSubjects = planRecordSubjects;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "ID", unique = true, nullable = false)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "TOPIC_ID")
	public Topic getTopicByTopicId() {
		return this.topicByTopicId;
	}

	public void setTopicByTopicId(Topic topicByTopicId) {
		this.topicByTopicId = topicByTopicId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "PLAN_ID", nullable = false)
	public TrainPlan getTrainPlan() {
		return this.trainPlan;
	}

	public void setTrainPlan(TrainPlan trainPlan) {
		this.trainPlan = trainPlan;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "REVIEW_TOPIC_ID")
	public Topic getTopicByReviewTopicId() {
		return this.topicByReviewTopicId;
	}

	public void setTopicByReviewTopicId(Topic topicByReviewTopicId) {
		this.topicByReviewTopicId = topicByReviewTopicId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "RECORD_ID", nullable = false)
	public PlanRecord getPlanRecord() {
		return this.planRecord;
	}

	public void setPlanRecord(PlanRecord planRecord) {
		this.planRecord = planRecord;
	}

	@Column(name = "ACTUAL_TRAINING_TIME")
	public Integer getActualTrainingTime() {
		return this.actualTrainingTime;
	}

	public void setActualTrainingTime(Integer actualTrainingTime) {
		this.actualTrainingTime = actualTrainingTime;
	}

	@Column(name = "TEACHER_COMMENT", length = 65535)
	public String getTeacherComment() {
		return this.teacherComment;
	}

	public void setTeacherComment(String teacherComment) {
		this.teacherComment = teacherComment;
	}

	@Column(name = "FINISHED", nullable = false)
	public boolean isFinished() {
		return this.finished;
	}

	public void setFinished(boolean finished) {
		this.finished = finished;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "planRecordTopic")
	public Set<PlanRecordSubject> getPlanRecordSubjects() {
		return this.planRecordSubjects;
	}

	public void setPlanRecordSubjects(Set<PlanRecordSubject> planRecordSubjects) {
		this.planRecordSubjects = planRecordSubjects;
	}

}
